package com.yami.shop.multishop.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yami.shop.bean.model.MeltCloudUltraGroupRecord;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.MeltCloudUltraGroupRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shop/ultra/group/record")
@Tag(name = "融云超级群记录")
@AllArgsConstructor
public class MeltCloudUltraGroupRecordController {

    private final MeltCloudUltraGroupRecordService ultraGroupRecordService;

    @GetMapping("/list")
    @Operation(summary =  "申请超级群列表")
    public ServerResponseEntity<List<MeltCloudUltraGroupRecord>> list(@RequestParam Long applyId){
        List<MeltCloudUltraGroupRecord> list = ultraGroupRecordService.list(Wrappers.lambdaQuery(MeltCloudUltraGroupRecord.class).eq(MeltCloudUltraGroupRecord::getGroupApplyId, applyId));
        return ServerResponseEntity.success(list);
    }
    
}
